package com.itheima.service;

import com.alibaba.dubbo.config.annotation.Service;
import com.itheima.dao.MemberDao;
import com.itheima.pojo.Member;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

@Service(interfaceClass = MemberService.class)
@Transactional
public class MemberServiceImpl implements MemberService{
    @Autowired
    MemberDao memberDao;
    @Override
    public Member findDyTelephone(String telephone) {
        return memberDao.findByTelephone(telephone);
    }

    @Override
    public Member add(Member member) {
        memberDao.add(member);
        //这里可以拿到主键
        return member;//返回之后就可以在web拿到主键
    }
}
